package edu.zut.main.thread;

public class ThreadDemo3 {

    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            //run 中是线程任务
            @Override
            public void run() {
//                Thread.currentThread().getName()  获取当前线程的名称
                System.out.println(Thread.currentThread().getName() + " begin.....");
            }
        },"ThreadA");
        thread.start();

        Thread thread2 = new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + " begin.....");
        },"ThreadB");
        thread2.start();


    }

}
